package com.test.kotlin05

class PlayerTest {
    var name:String ="jack"
    get() = field.capitalize()
    set(value){
        field = value.trim()
    }

    val rolledValue
    get() = (1..6).shuffled().first()


    var words:String? = "hello lwb"
    fun saySomething(){
        words?.also {
            println("Hello ${it.toUpperCase()}" )
        }
    }
}


fun main() {
    var player = PlayerTest()
//    player.name = "roseplayer"
    println(player.name)
    player.name = " rose "
    println(player.name)


    println(player.rolledValue)

    player.saySomething()
}